"use strict";(globalThis.webpackChunk_github_ui_github_ui=globalThis.webpackChunk_github_ui_github_ui||[]).push([["packages_history_history_ts-packages_promise-with-resolvers-polyfill_promise-with-resolvers-p-2cdd04"],{15838:(e,t,n)=>{n.d(t,{Cd:()=>c,E5:()=>i,Im:()=>l,nW:()=>o});var a=n(11083),s=n(94416);let r="stats:soft-nav-duration",o={turbo:"TURBO",react:"REACT","turbo.frame":"FRAME",ui:"UI",hard:"HARD"};function i(){window.performance.clearResourceTimings(),window.performance.mark(r)}function c(e){(0,a.i)({turboFailureReason:e,turboStartUrl:(0,s.dR)(),turboEndUrl:window.location.href})}function l(){let e=function(){if(0===performance.getEntriesByName(r).length)return null;performance.measure(r,r);let e=performance.getEntriesByName(r).pop();return e?e.duration:null}();if(!e)return;let t=o[(0,s.di)()],n=Math.round(e);t===o.react&&document.dispatchEvent(new CustomEvent("staffbar-update",{detail:{duration:n}})),(0,a.i)({requestUrl:window.location.href,softNavigationTiming:{mechanism:t,destination:(0,s.fX)()||"rails",duration:n,initiator:(0,s.Pv)()||"rails"}})}},28600:(e,t,n)=>{n.d(t,{A:()=>i});let{getItem:a,setItem:s,removeItem:r}=(0,n(82075).A)("localStorage"),o="REACT_PROFILING_ENABLED",i={enable:()=>s(o,"true"),disable:()=>r(o),isEnabled:()=>!!a(o)}},40064:(e,t,n)=>{n.d(t,{V:()=>f});var a=n(74848),s=n(96540),r=n(43258),o=n(38621),i=n(52870),c=n(56149);let l={info:"",success:"Toast--success",error:"Toast--error"},d={info:(0,a.jsx)(o.InfoIcon,{}),success:(0,a.jsx)(o.CheckIcon,{}),error:(0,a.jsx)(o.StopIcon,{})},u=({message:e,timeToLive:t,icon:n,type:r="info",role:o="log"})=>{let[u,f]=s.useState(!0),{safeSetTimeout:v}=(0,i.A)();return(0,s.useEffect)(()=>{t&&v(()=>f(!1),t-300)},[v,t]),(0,a.jsx)(c.ZL,{children:(0,a.jsx)("div",{className:"p-1 position-fixed bottom-0 left-0 mb-3 ml-3",children:(0,a.jsxs)("div",{className:`Toast ${l[r]} ${u?"Toast--animateIn":"Toast--animateOut"}`,id:"ui-app-toast","data-testid":`ui-app-toast-${r}`,role:o,children:[(0,a.jsx)("span",{className:"Toast-icon",children:n||d[r]}),(0,a.jsx)("span",{className:"Toast-content",children:e})]})})})};try{u.displayName||(u.displayName="Toast")}catch{}function f(){let{toasts:e,persistedToast:t}=(0,s.useContext)(r.T8);return(0,a.jsxs)(a.Fragment,{children:[e.map((e,t)=>(0,a.jsx)(u,{message:e.message,icon:e.icon,timeToLive:r.Qn,type:e.type,role:e.role},t)),t&&(0,a.jsx)(u,{message:t.message,icon:t.icon,type:t.type,role:t.role})]})}try{f.displayName||(f.displayName="Toasts")}catch{}},42255:(e,t,n)=>{n.d(t,{A:()=>r});var a=n(70263),s=n(96540);let r=function(e){let t=(0,a.A)(),[n,r]=(0,s.useState)(e);return[n,(0,s.useCallback)(e=>{t()&&r(e)},[t])]}},43258:(e,t,n)=>{n.d(t,{Qn:()=>c,T8:()=>d,Y6:()=>f,k6:()=>u});var a=n(74848),s=n(52870),r=n(96540),o=n(73189),i=n(42255);let c=5e3,l=(0,r.createContext)({addToast:o.l,addPersistedToast:o.l,clearPersistedToast:o.l}),d=(0,r.createContext)({toasts:[],persistedToast:null});function u({children:e}){let[t,n]=(0,i.A)([]),[o,u]=(0,r.useState)(null),{safeSetTimeout:f}=(0,s.A)(),v=(0,r.useCallback)(function(e){n([...t,e]),f(()=>n(t.slice(1)),c)},[t,f,n]),p=(0,r.useCallback)(function(e){u(e)},[u]),h=(0,r.useCallback)(function(){u(null)},[u]),m=(0,r.useMemo)(()=>({addToast:v,addPersistedToast:p,clearPersistedToast:h}),[p,v,h]),E=(0,r.useMemo)(()=>({toasts:t,persistedToast:o}),[t,o]);return(0,a.jsx)(l.Provider,{value:m,children:(0,a.jsx)(d.Provider,{value:E,children:e})})}function f(){return(0,r.useContext)(l)}try{l.displayName||(l.displayName="ToastContext")}catch{}try{d.displayName||(d.displayName="InternalToastsContext")}catch{}try{u.displayName||(u.displayName="ToastContextProvider")}catch{}},49936:(e,t,n)=>{n.d(t,{I:()=>a});let a=(0,n(96540).createContext)(null)},51407:(e,t,n)=>{n.d(t,{Y:()=>a});function a(){let e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}},53627:(e,t,n)=>{n.d(t,{C3:()=>i,JV:()=>s,K3:()=>u,MM:()=>c,OE:()=>f,Zu:()=>d,bj:()=>r,jc:()=>l,kd:()=>o});var a=n(71315);function s(){return a.Kn?.state||{}}function r(e){v(s(),"",e)}function o(e){a.Kn?.pushState({appId:s().appId},"",e),p()}function i(e){v({...s(),...e},"",location.href)}function c(e){r(`?${e.toString()}${a.fV.hash}`)}function l(){r(a.fV.pathname+a.fV.hash)}function d(e){r(e.startsWith("#")?e:`#${e}`)}function u(){r(a.fV.pathname+a.fV.search)}function f(){a.Kn?.back()}function v(e,t,n){a.Kn?.replaceState(e,t,n),p()}function p(){a.cg?.dispatchEvent(new CustomEvent("statechange",{bubbles:!1,cancelable:!1}))}},57224:(e,t,n)=>{n.d(t,{y:()=>o});var a=n(74848),s=n(21728),r=n(49936);function o(e){let t,n,o=(0,s.c)(7),{children:i,appName:c,category:l,metadata:d}=e;o[0]!==c||o[1]!==l||o[2]!==d?(t={appName:c,category:l,metadata:d},o[0]=c,o[1]=l,o[2]=d,o[3]=t):t=o[3];let u=t;return o[4]!==i||o[5]!==u?(n=(0,a.jsx)(r.I.Provider,{value:u,children:i}),o[4]=i,o[5]=u,o[6]=n):n=o[6],n}try{o.displayName||(o.displayName="AnalyticsProvider")}catch{}},65432:(e,t,n)=>{n.d(t,{Bu:()=>p,SC:()=>l,Ti:()=>f,iS:()=>d,k5:()=>c,o4:()=>u,rZ:()=>v});var a=n(82591),s=n(73900),r=n(15838),o=n(94416);let i=0;function c(){i=0,document.dispatchEvent(new Event(a.z.INITIAL)),(0,o.xT)()}function l(e){(0,o.LM)()||(document.dispatchEvent(new Event(a.z.PROGRESS_BAR.START)),document.dispatchEvent(new s.sW(e)),(0,o.Vy)(e),(0,o.ZW)(),(0,o.HK)(),(0,r.E5)())}function d(e={}){m(e)&&(i+=1,document.dispatchEvent(new s.ni((0,o.di)(),i)),f(e))}function u(e={}){if(!m(e))return;i=0;let t=(0,o.my)()||o.BW;document.dispatchEvent(new s.Kq((0,o.di)(),t)),h(),(0,r.Cd)(t),(0,o.xT)()}function f(e={}){if(!m(e))return;let t=(0,o.di)();h(),document.dispatchEvent(new s.RQ(t)),(0,o.Ff)(),(0,o.JA)(t)}function v(e={}){m(e)&&((0,r.Im)(),document.dispatchEvent(new Event(a.z.RENDER)))}function p(){document.dispatchEvent(new Event(a.z.FRAME_UPDATE))}function h(){document.dispatchEvent(new Event(a.z.PROGRESS_BAR.END))}function m({skipIfGoingToReactApp:e,allowedMechanisms:t=[]}={}){return(0,o.LM)()&&(0===t.length||t.includes((0,o.di)()))&&(!e||!(0,o.gc)())}},70263:(e,t,n)=>{n.d(t,{A:()=>r});var a=n(88431),s=n(96540);function r(){let e=(0,s.useRef)(!1),t=(0,s.useCallback)(()=>e.current,[]);return(0,a.N)(()=>(e.current=!0,()=>{e.current=!1}),[]),t}},73189:(e,t,n)=>{n.d(t,{l:()=>a});let a=()=>void 0},73900:(e,t,n)=>{n.d(t,{Kq:()=>SoftNavErrorEvent,RQ:()=>SoftNavEndEvent,gh:()=>SoftNavPayloadEvent,ni:()=>SoftNavSuccessEvent,sW:()=>SoftNavStartEvent});var a=n(50467),s=n(82591);let r=class SoftNavEvent extends Event{constructor(e,t){super(t),(0,a._)(this,"mechanism",void 0),this.mechanism=e}};let SoftNavStartEvent=class SoftNavStartEvent extends r{constructor(e){super(e,s.z.START)}};let SoftNavSuccessEvent=class SoftNavSuccessEvent extends r{constructor(e,t){super(e,s.z.SUCCESS),(0,a._)(this,"visitCount",void 0),this.visitCount=t}};let SoftNavErrorEvent=class SoftNavErrorEvent extends r{constructor(e,t){super(e,s.z.ERROR),(0,a._)(this,"error",void 0),this.error=t}};let SoftNavEndEvent=class SoftNavEndEvent extends r{constructor(e){super(e,s.z.END)}};let SoftNavPayloadEvent=class SoftNavPayloadEvent extends Event{constructor(e){super("soft-nav:payload"),(0,a._)(this,"payload",void 0),(0,a._)(this,"appPayload",void 0),this.payload=e.payload,this.appPayload=e.appPayload}}},76629:(e,t,n)=>{n.d(t,{BP:()=>u,D3:()=>d,O8:()=>c});var a=n(74848),s=n(21728),r=n(96540),o=n(71315),i=n(88431);let c={ServerRender:"ServerRender",ClientHydrate:"ClientHydrate",ClientRender:"ClientRender"},l=(0,r.createContext)(c.ClientRender);function d(e){let t,n,d,u,f=(0,s.c)(8),{wasServerRendered:v,children:p}=e;f[0]!==v?(t=()=>o.X3?c.ServerRender:v?c.ClientHydrate:c.ClientRender,f[0]=v,f[1]=t):t=f[1];let[h,m]=(0,r.useState)(t);return f[2]!==h?(n=()=>{h!==c.ClientRender&&m(c.ClientRender)},d=[h],f[2]=h,f[3]=n,f[4]=d):(n=f[3],d=f[4]),(0,i.N)(n,d),f[5]!==p||f[6]!==h?(u=(0,a.jsx)(l.Provider,{value:h,children:p}),f[5]=p,f[6]=h,f[7]=u):u=f[7],u}function u(){return(0,r.useContext)(l)}try{l.displayName||(l.displayName="RenderPhaseContext")}catch{}try{d.displayName||(d.displayName="RenderPhaseProvider")}catch{}},82591:(e,t,n)=>{n.d(t,{z:()=>a});let a=Object.freeze({INITIAL:"soft-nav:initial",START:"soft-nav:start",REPLACE_MECHANISM:"soft-nav:replace-mechanism",SUCCESS:"soft-nav:success",ERROR:"soft-nav:error",FRAME_UPDATE:"soft-nav:frame-update",END:"soft-nav:end",RENDER:"soft-nav:render",PROGRESS_BAR:{START:"soft-nav:progress-bar:start",END:"soft-nav:progress-bar:end"}})},88431:(e,t,n)=>{n.d(t,{N:()=>r});var a=n(71315),s=n(96540);let r=void 0!==a.cg?.document?.createElement?s.useLayoutEffect:s.useEffect}}]); //# sourceMappingURL=packages_history_history_ts-packages_promise-with-resolvers-polyfill_promise-with-resolvers-p-2cdd04-d42f1c82ade7.js.map